package cn.chenhuanming.shh.administer.entity.jpa;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * UserRole entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "user_role", catalog = "house")
public class UserRole implements java.io.Serializable {

	// Fields

	private String id;
	private String name;
	private String remark;
	private String status;
	private Set<UserSystem> userSystems = new HashSet<UserSystem>(0);

	// Constructors

	/** default constructor */
	public UserRole() {
	}

	/** minimal constructor */
	public UserRole(String id, String name, String status) {
		this.id = id;
		this.name = name;
		this.status = status;
	}

	/** full constructor */
	public UserRole(String id, String name, String remark, String status,
			Set<UserSystem> userSystems) {
		this.id = id;
		this.name = name;
		this.remark = remark;
		this.status = status;
		this.userSystems = userSystems;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false, length = 50)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "name", nullable = false, length = 30)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "remark", length = 200)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "status", nullable = false, length = 3)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "userRole")
	public Set<UserSystem> getUserSystems() {
		return this.userSystems;
	}

	public void setUserSystems(Set<UserSystem> userSystems) {
		this.userSystems = userSystems;
	}

}